package butines.game.lastcolony.entities;

import java.awt.Graphics2D;
import java.util.List;

import butines.core.GameImage;


public abstract class Entity {

	protected Game game;
    
    protected EntityTeam team;
	protected EntityAction action;
	protected EntityOrders orders;

	protected int UID;
	protected float x, y; // grid
	protected float direction;
	
	protected int life;
	protected String lifeCode;
	protected boolean selected;
	
	protected EntityClass entityClass;
	
    protected int imageOffset;
	protected int animationIndex;
	protected EntitySprite imageList;
	
	public abstract void processOrders();

	public abstract void animate();

	public abstract void draw(Graphics2D g2d);

    public int getUID() {
        return UID;
    }

    public void setUID(int UID) {
        this.UID = UID;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public int getLife() {
        return life;
    }

    public void setLife(int life) {
        this.life = life;
    }

    public String getLifeCode() {
        return lifeCode;
    }

    public void setLifeCode(String lifeCode) {
        this.lifeCode = lifeCode;
    }

    public EntityClass getEntityClass() {
        return entityClass;
    }

    public void setEntityClass(EntityClass entityClass) {
        this.entityClass = entityClass;
    }

    public Game getGame() {
        return game;
    }

    public void setGame(Game game) {
        this.game = game;
    }

    public EntityAction getAction() {
        return action;
    }

    public void setAction(EntityAction action) {
        this.action = action;
    }

    public EntityTeam getTeam() {
        return team;
    }

    public void setTeam(EntityTeam team) {
        this.team = team;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public void setY(int y) {
        this.y = y;
    }
    
    public void setX(int x) {
        this.x = x;
    }
    
    public float getDirection() {
        return direction;
    }

    public void setDirection(float direction) {
        this.direction = direction;
    }
    
    public void setDirection(int direction) {
        this.direction = direction;
    }
    
    public boolean isDead() {
        return "dead".equals(lifeCode);
    }
    
    public boolean isHealthy() {
        return "healthy".equals(lifeCode);
    }
    
    public EntityOrders getOrders() {
        return orders;
    }

    public void setOrders(EntityOrders orders) {
        this.orders = orders;
    }
    
    

    // Delegate to EntityClass
    public boolean isSelectable() {
        return entityClass.isSelectable();
    }

    public String getName() {
        return entityClass.getName();
    }

    public int getPixelWidth() {
        return entityClass.getPixelWidth();
    }

    public int getPixelHeight() {
        return entityClass.getPixelHeight();
    }

    public int getPixelOffsetX() {
        return entityClass.getPixelOffsetX();
    }

    public int getPixelOffsetY() {
        return entityClass.getPixelOffsetY();
    }

    public int getBaseWidth() {
        return entityClass.getBaseWidth();
    }

    public int getBaseHeight() {
        return entityClass.getBaseHeight();
    }

    public int[][] getBuildableGrid() {
        return entityClass.getBuildableGrid();
    }

    public int[][] getPassableGrid() {
        return entityClass.getPassableGrid();
    }

    public int getSight() {
        return entityClass.getSight();
    }

    public int getHitPoints() {
        return entityClass.getHitPoints();
    }

    public int getCost() {
        return entityClass.getCost();
    }

    public GameImage getSpriteSheet() {
        return entityClass.getSpriteSheet();
    }

    public List<EntitySprite> getSpriteArray() {
        return entityClass.getSpriteArray();
    }

    public int getSpriteCount() {
        return entityClass.getSpriteCount();
    }

    public EntitySprite getEntitySprite(String name) {
        return entityClass.getEntitySprite(name);
    }

    public boolean isCanAttack() {
        return entityClass.isCanAttack();
    }

    public boolean isCanAttackLand() {
        return entityClass.isCanAttackLand();
    }

    public boolean isCanAttackAir() {
        return entityClass.isCanAttackAir();
    }

    public WeaponType getWeaponType() {
        return entityClass.getWeaponType();
    }

    public int getRadius() {
        return entityClass.getRadius();
    }

    public int getSpeed() {
        return entityClass.getSpeed();
    }

    public int getTurnSpeed() {
        return entityClass.getTurnSpeed();
    }

    public int getPixelShadowHeight() {
        return entityClass.getPixelShadowHeight();
    }

    public int getDirections() {
        return entityClass.getDirections();
    }
    
}
